﻿using Newtonsoft.Json;
using System.Collections.Generic;

namespace VisionCloud.Domain.DtoModel.Ms
{
    /// <summary>
    /// 测量站点数，爆点数对应measureinfojson字段
    /// </summary>
    public class MeasureInfo
    {
        /// <summary>
        /// 测量项代码
        /// </summary>
        public string code { get; set; }

        /// <summary>
        /// 爆尺数文本
        /// </summary>
        public string text { get; set; } = string.Empty;

        /// <summary>
        /// 名称
        /// </summary>
        public string title { get; set; }

        /// <summary>
        /// 测量数目
        /// </summary>
        public int number { get; set; }

        private int _nopassnumber;

        /// <summary>
        /// 测量未通过数
        /// </summary>
        public int nopassnumber
        {
            get
            {
                return _nopassnumber;
            }
            set
            {
                _nopassnumber = value;
                PassRate = (this.number - this.nopassnumber) * 1.0f / this.number;
            }
        }

        /// <summary>
        /// 附加字段
        /// </summary>
        public double? maxValue { get; set; }

        /// <summary>
        ///  附加字段
        /// </summary>
        public bool? iSserious { get; set; }

        /// <summary>
        /// 合格率
        /// </summary>
        [JsonIgnore]
        public double PassRate
        {
            get;
            set;
        }

        public MeasureInfo()
        {
        }
    }

    public class MeasureInfoArray
    {
        public int PointIndex { get; set; }
        public List<MeasureInfo> MeasureInfos { get; set; } = new List<MeasureInfo>();
    }

    /// <summary>
    /// 测量结果汇总
    /// </summary>
    public class MeasureSummaryInfo
    {
        /// <summary>
        /// 测量总数
        /// </summary>
        public int number { get; set; }

        /// <summary>
        /// 合格率
        /// </summary>
        public string percent { get; set; }

        /// <summary>
        /// 测量项名称
        /// </summary>
        public string itemname { get; set; }

        /// <summary>
        /// 测量不通过数
        /// </summary>
        public int nopassnumber { get; set; }

        /// <summary>
        /// 测量标注项
        /// </summary>
        public object standardvalue { get; set; }
    }

    /// <summary>
    /// 原位标注图Dto
    /// </summary>
    public class PlanViewLabelingDto
    {
        /// <summary>
        /// 原位标注图Url
        /// </summary>
        public string Url { get; set; }
    }
}